package com.itheima.cases;

import java.util.Random;
import java.util.Scanner;

public class TextDemo6 {
    public static void main(String[] args) {
        int[] arr = {9, 666, 188, 520, 99999};
        RandomMoney(arr);
    }

    public static void RandomMoney(int[] arr) {
        //arr = {9,666,188,520,99999};
        Scanner rs = new Scanner(System.in);
        Random ra = new Random();
        for (int i = 1; i <= 5; i++) {
            System.out.println("请您输入任意内容进行抽奖：");
            rs.next();
            while (true) {
                int Number = ra.nextInt(5);
                int money = arr[Number];
                if (money != 0) {
                    System.out.println("恭喜您，您抽中了红包，红包金额为 " + money + "￥ ！");
                    System.out.println("-------------------------------------------");
                    arr[Number] = 0;
                    break;
                }
            }
        }
        System.out.println("活动结束~");
    }
}
